public class BestForCustomerPricing extends ComplexPricing {

	private ISalePricing pricing;
	
	public BestForCustomerPricing(ISalePricing pricing){
		this.pricing = pricing;
	}
	
	public double getTotal(Sale sale) {
		sale.setPricing(pricing);
		double lowest = sale.getPreDiscountTotal();
			for(ISalePricing z: pricings){
				if(z.getTotal(sale)<lowest){
					lowest = z.getTotal(sale);
				}
				System.out.println(z.getTotal(sale));
			}
		return lowest;
	}
	
}
